package com.example.newleadcent.openplant.dao;


import com.example.newleadcent.entity.Realtime;
import org.springframework.stereotype.Repository;

@Repository
public class Realtime_dao extends Base_dao {

    public void updateCase() {
        //String sql = "update Realtime set AV=3 where ID=1024;";
        //String sql = "update Realtime set AV=1000 where GN like 'W3.LOCATION.LOCATION_LAT'";

        String sql = "update Realtime set AV=1000 where GN like 'W3.LOCATION.LOCATION_LAT'";
        executeSQL(sql);
    }

    public void selectCase() {
        String sql = "select * from Realtime limit 10";
        executeSelectSQL(sql);
    }

    public void deleteCase() {
        String sql = "delete from  Realtime where ID=1024;";
        executeSQL(sql);
    }

    public void insert(Realtime data) {
        String GN = data.getGN();
        double AV = data.getAV();

        String sql = "insert into Realtime (GN,AV) values ('" + GN + "'," + AV + ")";
        executeSQL(sql);
    }
}


